@echo off
setlocal enabledelayedexpansion
set str1=nothing to commit, working tree clean
::echo %str1%
::这里有个坑，要比较字符串，所以要加双引号。而且两边都要加双引号，要不然会不相等
for /F "delims=" %%i in ('git status') do (
	if "%%i"=="%str1%" (
		set flag=1
		echo set flag=!flag!
	) 
)
if defined flag (
	echo !str1!
) else (
	git add .
	git commit -m "%date:~0,10% %time:~0,2%:%time:~3,2%:%time:~6,2%"
	git push	
)

::pause
::timeout /t 5 /nobreak
exit